package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class FunctionSpecification {

    private int beginIndex;
    private int endIndex;
    private SchemaQualifiedName schemaQualifiedRoutineName;
    private SqlParameterDeclarationList sqlParameterDeclarationList;
    private ReturnsClause returnsClause;
    private RoutineCharacteristics routineCharacteristics;
    private DispatchClause dispatchClause;

    public FunctionSpecification(int beginIndex,
                                 SchemaQualifiedName schemaQualifiedRoutineName,
                                 SqlParameterDeclarationList sqlParameterDeclarationList,
                                 ReturnsClause returnsClause,
                                 RoutineCharacteristics routineCharacteristics,
                                 DispatchClause dispatchClause) {
        this.beginIndex = beginIndex;
        this.endIndex = dispatchClause != null ? dispatchClause.getEndIndex() : routineCharacteristics.getEndIndex();
        this.schemaQualifiedRoutineName = schemaQualifiedRoutineName;
        this.sqlParameterDeclarationList = sqlParameterDeclarationList;
        this.returnsClause = returnsClause;
        this.routineCharacteristics = routineCharacteristics;
        this.dispatchClause = dispatchClause;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public SchemaQualifiedName getSchemaQualifiedRoutineName() {
        return schemaQualifiedRoutineName;
    }

    public SqlParameterDeclarationList getSqlParameterDeclarationList() {
        return sqlParameterDeclarationList;
    }

    public ReturnsClause getReturnsClause() {
        return returnsClause;
    }

    public RoutineCharacteristics getRoutineCharacteristics() {
        return routineCharacteristics;
    }

    public DispatchClause getDispatchClause() {
        return dispatchClause;
    }

}
